<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS_浮动margin塌陷</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 100px;
            height: 260px;
            padding: 40px;
            border: 1px solid red;
            margin: 100px auto;
        }
        p{
            width: 100px;
            height: 100px;
            background: cyan;
            margin: 20px 0;
            float: left;
        }
    </style>
</head>
<body>
    <div>
        <p></p>
        <p></p>
    </div>
</body>
</html>